package com.ebt.m.proposal_v2.utils;

/**
 * Created by Allen.li on 2016/3/18.
 */
public enum EnumProfession {
    ONE(1), TWO(2), THREE(3), FOUR(4), FIVE(5), SIX(6);//   调用构造函数来构造枚举项

    private int value = 0;

    private EnumProfession(int value) {    //    必须是private的，否则编译错误
        this.value = value;
    }

    public static EnumProfession valueOf(int value) {    //    从int到enum的转换函数
        switch (value) {
            case 1:
                return ONE;
            case 2:
                return TWO;
            case 3:
                return THREE;
            case 4:
                return FOUR;
            case 5:
                return FIVE;
            case 6:
                return SIX;
            default:
                return null;
        }
    }

    public int value() {
        return this.value;
    }
}
